package com.book.oauth.server.login.log.hystrix;

import com.book.common.result.RestResponse;
import com.book.common.result.PageInfo;
import com.book.oauth.server.login.log.dto.LoginLogDto;
import com.book.oauth.server.login.log.vo.LoginLogVo;
import com.book.oauth.server.login.log.hystrix.impl.LoginLogHystrixImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Description：登录日志 Hystrix
 *
 * @Author： leo.xiong
 * @CreateDate： 2020-05-26
 * @Email： leo.xiong@suyun360.com
 * Version:
 */
@FeignClient(value = "oauth-server", fallbackFactory = LoginLogHystrixImpl.class)
public interface ILoginLogHystrix {
    /**
     * 根据ID获取登录日志信息
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/server/loginLog/{id}", consumes = "application/json")
    RestResponse<LoginLogVo> get(@PathVariable(value = "id") String id);

    /**
     * 查询登录日志信息
     *
     * @param loginLogDto
     * @return
     */
    @PostMapping(value = "/server/loginLog/list", consumes = "application/json")
    RestResponse<List<LoginLogVo>> list(@RequestBody LoginLogDto loginLogDto);

    /**
     * 查询登录日志信息
     *
     * @param loginLogDto
     * @return
     */
    @PostMapping(value = "/server/loginLog/page/list", consumes = "application/json")
    RestResponse<PageInfo<LoginLogVo>> pageList(@RequestBody LoginLogDto loginLogDto);

    /**
     * 新增登录日志信息
     *
     * @param loginLogDto
     * @return
     */
    @PostMapping(value = "/server/loginLog/save", consumes = "application/json")
    RestResponse<String> save(@RequestBody LoginLogDto loginLogDto);

    /**
     * 修改登录日志信息
     *
     * @param loginLogDto
     * @return
     */
    @PutMapping(value = "/server/loginLog/update", consumes = "application/json")
    RestResponse<String> update(@RequestBody LoginLogDto loginLogDto);

    /**
     * 删除登录日志信息
     *
     * @param id
     * @return
     */
    @DeleteMapping(value = "/server/loginLog/delete/{id}", consumes = "application/json")
    RestResponse<String> delete(@PathVariable(value = "id") String id);

    /**
     * 导出登录日志模板信息
     *
     * @return
     */
    @PostMapping(value = "/server/loginLog/export/template", consumes = "application/json")
    RestResponse<String> exportTemplate();

    /**
     * 导出登录日志信息
     *
     * @param loginLogDto
     * @return
     */
    @PostMapping(value = "/server/loginLog/export/excel", consumes = "application/json")
    RestResponse<String> exportExcel(@RequestBody LoginLogDto loginLogDto);

    /**
     * 导入登录日志信息
     *
     * @param filePath
     * @return
     */
    @PostMapping(value = "/server/loginLog/import/excel", consumes = "application/json")
    RestResponse<String> importExcel(@RequestParam(value = "filePath") String filePath);

}
